package com.ssy.lingxi.settle.accounts.service;

import com.ssy.lingxi.common.model.dto.UserLoginCacheDTO;
import com.ssy.lingxi.common.response.PageData;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.dto.request.AddSettlementApplyAmountVO;
import com.ssy.lingxi.dto.request.CallbackCommunicationPayVO;
import com.ssy.lingxi.dto.request.CommunicationPayVO;
import com.ssy.lingxi.dto.request.MemberSettlementBaseVO;
import com.ssy.lingxi.settle.accounts.model.bo.PayProveBO;
import com.ssy.lingxi.settle.accounts.model.vo.request.*;
import com.ssy.lingxi.settle.accounts.model.vo.response.*;

import java.util.List;

/**
 * 会员结算接口
 * @author 伍将
 * @date 2020/10/23
 * @version 2.0.0
 */
public interface IMemberSettlementService {

    /**
     * 分页查询应付账款结算
     * @author 伍将
     * @date 2020/10/23
     * @param sysUser:
     * @param pageVO:
     * @return com.ssy.lingxi.common.response.Wrapper<com.ssy.lingxi.common.response.PageData < com.ssy.lingxi.settle.accounts.mode.vo.response.MemberSettlementVO>>
     **/
    Wrapper<PageData<MemberSettlementVO>> pagePayableSettlement(UserLoginCacheDTO sysUser, MemberSettlementPageVO pageVO);

    /**
     * 获取应付账款结算详情
     * @author 伍将
     * @date 2020/10/23
     * @param sysUser:
     * @param id:
     * @return com.ssy.lingxi.common.response.Wrapper<com.ssy.lingxi.settle.accounts.mode.vo.response.MemberSettlementDetailVO>
     **/
    Wrapper<MemberSettlementDetailVO> getPayableDetail(UserLoginCacheDTO sysUser, Long id);

    /**
     * 付款
     * @author 伍将
     * @date 2020/10/23
     * @param sysUser:
     * @param payVO:
     * @return com.ssy.lingxi.common.response.Wrapper
     **/
    Wrapper<Void> pay(UserLoginCacheDTO sysUser, PayVO payVO);

    /**
     * 付款方查看凭证
     * @author 伍将
     * @date 2020/10/23
     * @param sysUser:
     * @param id:
     * @return com.ssy.lingxi.common.response.Wrapper<java.util.List < com.ssy.lingxi.settle.accounts.mode.bo.PayProveBO>>
     **/
    Wrapper<List<PayProveBO>> getPayablePayProve(UserLoginCacheDTO sysUser, Long id);

    /**
     * 分页查询应收账款结算
     * @param sysUser 登录用户
     * @param pageVO 查询条件
     * @return 分页查询应收账款结算
     */
    Wrapper<PageData<MemberSettlementVO>> pageReceivableSettlement(UserLoginCacheDTO sysUser, MemberSettlementPageVO pageVO);

    /**
     * 获取应收款账款结算详情
     * @author 伍将
     * @date 2020/10/23
     * @param sysUser:
     * @param id:
     * @return com.ssy.lingxi.common.response.Wrapper<com.ssy.lingxi.settle.accounts.mode.vo.response.MemberSettlementDetailVO>
     **/
    Wrapper<MemberSettlementDetailVO> getReceivableDetail(UserLoginCacheDTO sysUser, Long id);

    /**
     * 确认对账完成
     * @author 伍将
     * @date 2020/10/23
     * @param sysUser: 
     * @param completeVO:
     * @return com.ssy.lingxi.common.response.Wrapper
     **/
    Wrapper<Void> confirmAccountComplete(UserLoginCacheDTO sysUser, ConfirmAccountCompleteVO completeVO);

    /**
     * 确认付款凭证
     * @author 伍将
     * @date 2020/10/23
     * @param sysUser:
     * @param confirmVO:
     * @return com.ssy.lingxi.common.response.Wrapper
     **/
    Wrapper<Void> confirmPayProve(UserLoginCacheDTO sysUser, ConfirmPayProve confirmVO);

    /**
     * 收款方查看凭证
     * @author 伍将
     * @date 2020/10/23
     * @param sysUser:
     * @param id:
     * @return com.ssy.lingxi.common.response.Wrapper<java.util.List < com.ssy.lingxi.settle.accounts.mode.bo.PayProveBO>>
     **/
    Wrapper<List<PayProveBO>> getReceivablePayProve(UserLoginCacheDTO sysUser, Long id);

    /**
     * 分页查询应付物流结算
     * @author 伍将
     * @date 2020/10/26
     * @param sysUser:
     * @param pageVO:
     * @return com.ssy.lingxi.common.response.Wrapper<com.ssy.lingxi.common.response.PageData < com.ssy.lingxi.settle.accounts.mode.vo.response.MemberLogisticsSettlementVO>>
     **/
    Wrapper<PageData<MemberLogisticsSettlementVO>> pagePayableLogisticsSettlement(UserLoginCacheDTO sysUser, MemberLogisticsSettlementPageVO pageVO);

    /**
     * 分页查询应收物流结算
     * @author 伍将
     * @date 2020/10/26
     * @param sysUser:
     * @param pageVO:
     * @return com.ssy.lingxi.common.response.Wrapper<com.ssy.lingxi.common.response.PageData < com.ssy.lingxi.settle.accounts.mode.vo.response.MemberLogisticsSettlementVO>>
     **/
    Wrapper<PageData<MemberLogisticsSettlementVO>> pageReceivableLogisticsSettlement(UserLoginCacheDTO sysUser, MemberLogisticsSettlementPageVO pageVO);

    /**
     * 分页查询应付生产通知单结算
     * @author 伍将
     * @date 2020/10/26
     * @param sysUser: 
     * @param pageVO: 
     * @return com.ssy.lingxi.common.response.Wrapper<com.ssy.lingxi.common.response.PageData < com.ssy.lingxi.settle.accounts.mode.vo.response.MemberProductionNoticeSettlementVO>>
     **/
    Wrapper<PageData<MemberProductionNoticeSettlementVO>> pagePayableProductionNoticeSettlement(UserLoginCacheDTO sysUser, MemberProductionNoticeSettlementPageVO pageVO);

    /**
     * 分页查询应收生产通知单结算
     * @author 伍将
     * @date 2020/10/26
     * @param sysUser:
     * @param pageVO:
     * @return com.ssy.lingxi.common.response.Wrapper<com.ssy.lingxi.common.response.PageData < com.ssy.lingxi.settle.accounts.mode.vo.response.MemberProductionNoticeSettlementVO>>
     **/
    Wrapper<PageData<MemberProductionNoticeSettlementVO>> pageReceivableProductionNoticeSettlement(UserLoginCacheDTO sysUser, MemberProductionNoticeSettlementPageVO pageVO);

    /**
     * 新增请款单
     * @author 伍将
     * @date 2021/3/24
     * @param addVO: 新增请求参数
     * @return 操作结果
     **/
    Wrapper<Void> addApplyAmount(AddSettlementApplyAmountVO addVO);

    /**
     * 分页查询应付订单结算
     * @param sysUser 登录用户
     * @param pageVO 查询条件
     * @return 分页查询应付订单结算
     */
    Wrapper<PageData<MemberOrderSettlementVO>> pagePayableOrderSettlement(UserLoginCacheDTO sysUser, MemberOrderSettlementPageVO pageVO);

    /**
     * 分页查询应收订单结算
     * @param sysUser 登录用户
     * @param pageVO 查询条件
     * @return 分页查询应收订单结算
     */
    Wrapper<PageData<MemberOrderSettlementVO>> pageReceivableOrderSettlement(UserLoginCacheDTO sysUser, MemberOrderSettlementPageVO pageVO);

    /**
     * 通联支付付款
     * @author 彭冬冬
     * @date 2021/11/30
     * @param sysUser 登录用户
     * @param communicationPayVO 通联支付需要数据
     * @return 支付结果
     */
    Wrapper<String> communicationPay(UserLoginCacheDTO sysUser, CommunicationPayVO communicationPayVO);

    /**
     * 应付账款管理 - 通联支付:付款方查看凭证
     * @author 彭冬冬
     * @date 2021/11/30
     * @param sysUser 登录用户
     * @param id 结算单id
     * @return 通联支付:付款方查看凭证
     */
    Wrapper<CommunicationPayProveVO> getPayableCommunicationPayProve(UserLoginCacheDTO sysUser, Long id);

    /**
     * 应收账款管理 - 通联支付:付款方查看凭证
     * @author 彭冬冬
     * @date 2021/11/30
     * @param sysUser 登录用户
     * @param id 结算单id
     * @return 通联支付:付款方查看凭证
     */
    Wrapper<CommunicationPayProveVO> getReceivableCommunicationPayProve(UserLoginCacheDTO sysUser, Long id);

    /**
     * 通联支付-消费申请回调调用
     * @param callbackCommunicationPayVO 回调支付请求数据
     * @return 修改结算状态
     */
    Wrapper<Boolean> callbackCommunicationPay(CallbackCommunicationPayVO callbackCommunicationPayVO);

    /**
     * 返回通联支付调用支付结果
     * @param sysUser 登录用户
     * @param settlementNo 结算单号
     * @return 返回通联支付调用支付结果
     */
    Wrapper<Boolean> getAllInPayResult(UserLoginCacheDTO sysUser, String settlementNo);

    /**
     * 返回结算单通联支付的订单号
     * @param sysUser 登录用户
     * @param id 结算id
     * @return 返回结算单通联支付的订单号
     */
    Wrapper<String> getAllInPayTradeNo(UserLoginCacheDTO sysUser, Long id);

    /**
     * 新增保存会员结算
     * @param saveVO 会员结算数据
     * @return 保存杰哥
     */
    Wrapper<Void> save(MemberSettlementBaseVO saveVO);
}
